package com.chanta.server.persistence;

import java.util.Date;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * TODO Please comment this class..
 * 
 * @author Hakan Özdemir - Vendoo Inc.
 * @date 02.11.2013
 * 
 */
@PersistenceCapable
public class Rule {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private String name;

	@Persistent
	private String description;

	@Persistent
	private Date enabledFrom;

	@Persistent
	private Date enabledTo;

	@Persistent
	private Date activeFromTime;

	@Persistent
	private Date activeToTime;

	@Persistent
	private String state;

	/** do not rename */
	@Persistent
	private Portal portal;

	@Persistent
	private Set<Key> libraries;

	/**
	 * Getter for name.
	 * 
	 * @return name
	 */
	public String getName() {
		return name;
	}

	/**
	 * Setter for name.
	 * 
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Getter for description.
	 * 
	 * @return description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Setter for description.
	 * 
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Getter for enabledFrom.
	 * 
	 * @return enabledFrom
	 */
	public Date getEnabledFrom() {
		return enabledFrom;
	}

	/**
	 * Setter for enabledFrom.
	 * 
	 * @param enabledFrom
	 *            the enabledFrom to set
	 */
	public void setEnabledFrom(Date enabledFrom) {
		this.enabledFrom = enabledFrom;
	}

	/**
	 * Getter for enabledTo.
	 * 
	 * @return enabledTo
	 */
	public Date getEnabledTo() {
		return enabledTo;
	}

	/**
	 * Setter for enabledTo.
	 * 
	 * @param enabledTo
	 *            the enabledTo to set
	 */
	public void setEnabledTo(Date enabledTo) {
		this.enabledTo = enabledTo;
	}

	/**
	 * Getter for activeFromTime.
	 * 
	 * @return activeFromTime
	 */
	public Date getActiveFromTime() {
		return activeFromTime;
	}

	/**
	 * Setter for activeFromTime.
	 * 
	 * @param activeFromTime
	 *            the activeFromTime to set
	 */
	public void setActiveFromTime(Date activeFromTime) {
		this.activeFromTime = activeFromTime;
	}

	/**
	 * Getter for activeToTime.
	 * 
	 * @return activeToTime
	 */
	public Date getActiveToTime() {
		return activeToTime;
	}

	/**
	 * Setter for activeToTime.
	 * 
	 * @param activeToTime
	 *            the activeToTime to set
	 */
	public void setActiveToTime(Date activeToTime) {
		this.activeToTime = activeToTime;
	}

	/**
	 * Getter for state.
	 * 
	 * @return state
	 */
	public String getState() {
		return state;
	}

	/**
	 * Setter for state.
	 * 
	 * @param state
	 *            the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}

	/**
	 * Getter for portal.
	 * 
	 * @return portal
	 */
	public Portal getPortal() {
		return portal;
	}

	/**
	 * Setter for portal.
	 * 
	 * @param portal
	 *            the portal to set
	 */
	public void setPortal(Portal portal) {
		this.portal = portal;
	}

	/**
	 * Getter for libraries.
	 * 
	 * @return libraries
	 */
	public Set<Key> getLibraries() {
		return libraries;
	}

	/**
	 * Setter for libraries.
	 * 
	 * @param libraries
	 *            the libraries to set
	 */
	public void setLibraries(Set<Key> libraries) {
		this.libraries = libraries;
	}
}
